# Low Level CLI

Touca C++ SDK ships with a low-level command-line tool `touca_cli` that lets you
view local touca binary archives and compare them with each other. This
command-line tool can be built by passing `--with-cli` when using the `build.sh`
script or by passing the `-DTOUCA_BUILD_CLI` flag when invoking cmake.

```bash
git clone git@github.com:trytouca/trytouca.git
cd trytouca/sdk/cpp
./build.sh --with-cli
```

The build script generates a `touca_cli` executable in the `./local/dist/bin`
directory relative to the `sdk/cpp` directory. You can install this executable
for easier access from any working directory.

```bash
sudo cmake --install local/build
```

On most Unix systems, this command installs the executable to `/usr/local/bin`.

## Supported Operations

`touca_cli` supports two different operations. You can select the operational
mode by passing the appropriate `mode` as an argument to `touca_cli`. Each mode
has its own set of command line options and arguments. Use the argument `--help`
to obtain the list of supported options for each mode.

```bash
touca_cli view --help
```

### Viewing Result Files

You can use `--mode=view` that prints a JSON representation of the content of a
given Touca result file.

```bash
touca_cli view --src "path/to/some_file"
```

### Comparing Result Files

You can use `--mode=compare` to compare the captured data between two binary
result files.

```bash
touca_cli compare --src "path/to/some_file" --dst "path/to/another_file"
```
